<template>
  <div id="app">
    <div id="nav">
        <!-- 
            定义导航
                to属性：指定链接，即url路径
                tag属性：指定要渲染成的标签，默认会渲染为a标签
         -->
      <router-link to="/" tag="span">Home</router-link> |
      <router-link to="/about" tag="span">About</router-link> |
      <router-link to="/user" tag="span">User</router-link>
    </div>
    <!-- 
        渲染并展示对应的组件
     -->
    <transition
        enter-active-class="animated fadeInRight"
        leave-active-class="animated fadeOutLeft"
    >   
        <router-view/>
    </transition> 
  </div>
</template>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  span {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
